package ExamLab.Test3;

public class TrClass extends Thread{

    static int x=4;

    public static int getX(){
         //synchronized(this){
              x=x+1;
              return x;
         //}
    }

    public void run(){
         synchronized(this){
              x++;
              System.out.print(getX());
         }
    }

    public static void main(String args[])throws Exception{
         new TrClass().start();
         new TrClass().start();
         new TrClass().start();
    }

}
